package com.freely.service.impl;

import java.util.List;

import org.hibernate.criterion.DetachedCriteria;
import org.springframework.transaction.annotation.Transactional;

import com.alibaba.fastjson.JSONObject;
import com.freely.dao.UserDao;
import com.freely.domain.User;
import com.freely.service.UserService;

@Transactional
public class UserServiceImpl implements UserService {
	private UserDao userDao;
	
	public void setUserDao(UserDao userDao) {
		this.userDao = userDao;
	}


	@Override
	public void test(User user) {
		userDao.test(user);
	}
	
	/**
	 * 根据条件查询一行数据
	 */
	@Override
	public List<User> findByCondition(DetachedCriteria criteria) {
		return userDao.findByCondition(criteria);
	}

	/**
	 * 新增用户
	 */
	@Override
	public void addUser(User user) {
		userDao.addUser(user);
	}
/*
	
	
	@Override
	public int updatePassword(String user_email, String user_password) {
		System.out.println("bbb");
		return userDao.updatePassword(user_email,user_password);
	}

	
	@Override
	public int updateOnline(boolean flag,Long user_id) {
		return userDao.updateOnline(flag,user_id);
	}
*/


	@Override
	public int update(JSONObject modifyObj, JSONObject conditionObj) {
		return userDao.update(modifyObj,conditionObj);
	}


	
}
